<%--
  - Author		:	이 영호
  --%>
<%@ page language="java" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/pages/includes/taglibs.jspf" %>
<%@ include file="/WEB-INF/pages/includes/variables.jspf" %>
<%@ include file="/WEB-INF/pages/includes/doctype.jspf" %>
<html>
	<head>
<%@ include file="/WEB-INF/pages/includes/metatags.jspf" %>
		<title><fmt:message key="pages.title" /></title>
		<link rel="stylesheet" type="text/css" href="<c:url value="${dirStyles}/common.css" />" />

		<script type="text/javascript" src="<c:url value="${dirScripts}/jquery-1.7.2.min.js" />"></script>
		<script type="text/javascript">
			$(function(){
			});
			
			function goAction(type){
				if(type == "modify"){
					document.modifyFrm.fAct.value='modify';
					document.modifyFrm.action="<c:url value="/backoffice/user/form.do" />";
					document.modifyFrm.submit();
				}else if(type == "remove" && confirm("삭제하시겠습니까?")){
					document.modifyFrm.fAct.value='remove';
					document.modifyFrm.action="<c:url value="/backoffice/user/submit.do" />";
					document.modifyFrm.submit();
				}else if(type == "reuse" && confirm("탈퇴를 취소하시겠습니까?")){
					document.modifyFrm.fAct.value='reuse';
					document.modifyFrm.action="<c:url value="/backoffice/user/submit.do" />";
					document.modifyFrm.submit();
				}
			}

		</script>
	</head>
	<body>
<%@ include file="/WEB-INF/pages/includes/header.jsp" %>
		<div class="bodyWrap">
<%@ include file="/WEB-INF/pages/includes/left.jsp" %>
			<div class="contWrap">
				<div class="contMenuTitle">
					<img src="<c:url value="${dirImages}/subtit_07_1.gif" />" title="회원관리" alt="회원관리">
				</div>
				<div class="secTitle">
					<img src="<c:url value="${dirImages}/icon.png" />" title="회원관리" alt="회원관리" > 회원관리
				</div>
				<form name="frm" method="post" action="<c:url value="/backoffice/user/submit.do" />" onsubmit="return validation();">
					<table class="formTbl">
						<colgroup>
							<col width="140px" />
							<col width="*" />
						</colgroup>
						<caption style="color: #c9c9c9; font-size: 12px;"><font class="redFont">*</font>표시는 필수입력 사항</caption>
						<tbody>
							<tr>
								<th><font class="redFont">*</font> 아이디</th>
								<td>
									<c:out value="${user.id}" />
								</td>
								<th>회원상태</th>
								<td>
									<c:choose>
										<c:when test="${user.isDel eq 1}">탈퇴회원</c:when>
										<c:when test="${user.enabled eq 0}">가입대기</c:when>
										<c:when test="${user.enabled eq 1}">정회원</c:when>
										<c:otherwise>
											<c:out value="${user.enabled}" />
										</c:otherwise>
									</c:choose>
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 사업자 등록 번호</th>
								<td colspan="3">
									<c:out value="${user.bizNum}" />
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 이름</th>
								<td colspan="3">
									<c:out value="${user.name}" />
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 이메일</th>
								<td colspan="3">
									<c:out value="${user.email}" />
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 업체명</th>
								<td colspan="3">
									<c:out value="${user.bizNm}" />
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 부서명</th>
								<td colspan="3">
									<c:out value="${user.team}" />
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 회원등급</th>
								<td colspan="3">
									<c:choose>
										<c:when test="${user.authority eq 'ROLE_ADMIN'}">운영자</c:when>
										<c:when test="${user.authority eq 'ROLE_USER'}">일반회원</c:when>
										<c:when test="${user.authority eq 'ROLE_TESTER'}">체험단</c:when>
										<c:otherwise>
											<c:out value="${user.authority}" />
										</c:otherwise>
									</c:choose>
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 전화번호</th>
								<td colspan="3">
									<c:out value="${user.tel}" />
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 휴대전화</th>
								<td colspan="3">
									<c:out value="${user.mobile}" />
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> FAX</th>
								<td colspan="3">
									<c:out value="${user.fax}" />
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 우편번호</th>
								<td colspan="3">
									<c:out value="${user.addrNum}" />
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 주소1</th>
								<td colspan="3">
									<c:out value="${user.addr1}" />
								</td>
							</tr>
							<tr>
								<th><font class="redFont">*</font> 주소2</th>
								<td colspan="3">
									<c:out value="${user.addr2}" />
								</td>
							</tr>
						</tbody>
					</table>
					<div class="btnWrap centerBtnWrap">
						<input type="button" class="btn btn_list" alt="목록" title="목록" onclick="javascript:document.listFrm.submit();">
						<c:if test="${user.id ne sessionScope.userId and user.isDel eq 0}">
							<input type="button" class="btn btn_delete" style="float:right; margin-left: 10px;" alt="삭제" title="삭제" onclick="javascript:goAction('remove');">
							<input type="button" class="btn btn_revision" style="float:right;" alt="수정" title="수정" onclick="javascript:goAction('modify');">
						</c:if>
						<c:if test="${user.isDel eq 1}">
							<input type="button" class="btn btn_reusemem" style="float:right;" alt="탈퇴취소" title="탈퇴취소" onclick="javascript:goAction('reuse');">
						</c:if>
					</div>
				</form>
			</div>
		</div>
		<form name="listFrm" method="post" action="<c:url value="/backoffice/user/list.do" />">
			<input type="hidden" name="maxnum" value="${param.maxnum}" />
			<input type="hidden" name="page" value="${param.page}" />
			<input type="hidden" name="searchType" value="${param.searchType}" />
			<input type="hidden" name="searchWord" value="${param.searchWord}" />
		</form>
		<form name="modifyFrm" method="post" action="">
			<input type="hidden" name="fAct" value="" />
			<input type="hidden" name="idx" value="${user.idx}" />
			<input type="hidden" name="maxnum" value="${param.maxnum}" />
			<input type="hidden" name="page" value="${param.page}" />
			<input type="hidden" name="searchType" value="${param.searchType}" />
			<input type="hidden" name="searchWord" value="${param.searchWord}" />
		</form>
		<%@ include file="/WEB-INF/pages/includes/footer.jsp" %>
	</body>
</html>